package com.example.xwcommon.service;

import com.example.xwcommon.entity.User;
import com.example.xwcommon.service.fallback.FallBackUserServiceImpl;
import com.example.xwcommon.vo.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value="xw-user",fallback = FallBackUserServiceImpl.class)
public interface UserService {
    @RequestMapping("/user/reg")
    Response<User> reg(@RequestParam("nickName") String nickName, @RequestParam("loginName") String loginName,
                        @RequestParam("loginpwd") String password, @RequestParam("photo") String photo);

    @RequestMapping("/user/login")
    Response<User> login(@RequestParam("loginName") String loginName, @RequestParam("loginpwd") String password);

    @RequestMapping("/user/addScore")
    Response<Integer> addScore(@RequestParam("loginName") String loginName,@RequestParam("score") Integer score);

    @RequestMapping("/user/updateState")
    Response<User> updateState(@RequestParam("loginName") String loginName,@RequestParam("state") Integer state);

    @RequestMapping("/user/getUserByLoginName")
    Response<User> getUserByLoginName(@RequestParam("loginName") String loginName);

    @RequestMapping("/user/getUserById")
    Response<User> getUserById(@RequestParam("userId") Integer userId);

    @RequestMapping("/user/updateAttentionCount")
    Response<User> updateAttentionCount(@RequestParam("loginName") String loginName,@RequestParam("attentionCount") Integer attentionCount);
    @RequestMapping("/user/getAllUser")
    Response<List<User>> getAllUser();

}